﻿<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>

<asp:Content ID="BodyContent"  runat="server" ContentPlaceHolderID="MainContent">

	<!-- BEGIN content -->
	<div id="content">
       
       <b>Filter By Category:  </b> &nbsp;
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
            SelectCommand="SELECT * FROM [Category] ORDER BY [CategoryName]"></asp:SqlDataSource>
           <asp:DropDownList ID="ddlCategory" runat="server"  Width="300px" 
            DataSourceID="SqlDataSource1" DataTextField="CategoryName" 
            DataValueField="CategoryID" Height="23px" AutoPostBack="true" AppendDataBoundItems="true">
            <asp:ListItem Selected="True" Value="0">All</asp:ListItem>
            </asp:DropDownList>
            <br /><br />
      
        <asp:DataList ID="DatalistParts" runat="server" DataKeyField="PartID" 
            RepeatColumns="2" CellSpacing="5" 
            ShowFooter="False" ShowHeader="False">
            <ItemTemplate>

		<!-- begin post -->
		<div class="odd post">
        <h3>

            <asp:HyperLink ID="HyperLink1" runat="server"            
            NavigateUrl='<%# String.Format("Details.aspx?PartID={0}", Eval("PartID")) %>' Text='<%# Eval("Name") %>' >
            </asp:HyperLink>
        </h3>  


         <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# String.Format("Details.aspx?PartID={0}", Eval("PartID")) %>'> 
          <asp:Image ID="bigImg" runat="server" ImageUrl='<%# Bind("BigImageUrl") %>' Width="100px" Height="100px" />
         
          </asp:HyperLink>

		<p><%# Eval("Description") %> </p>
         
        <p class="category">
        <small> 
        <a href="#"> <asp:Label ID="lblTotlaNoOfUsersWhoRated" runat="server"  /> 
          <asp:Label ID="lblAvgRatings" runat="server"  /> </a> 
        </small>
          </p>
           
		<p class="comments">  
        <small> 
         <a href="#"> <asp:Label ID="lblNoLikes" runat="server" /> Likes</a> 
          </small> 
        </p>
	
    	</div>
		<!-- end post -->


            </ItemTemplate>
        </asp:DataList>
      
		
	</div>
	<!-- END content -->

</asp:Content>

<asp:Content ID="Content1" runat="server" contentplaceholderid="SidebarContent">
       
       	<!-- BEGIN sidebar -->
	    <div id="sidebar">

          <div class="box">
		
            <h2>Other stuffs</h2>
            <br /> 

         </div>

	      <div class="box">
		
            <h2>Shopping Cart</h2>
            <br /> 

            
               <asp:GridView ID="gvwOrderedParts" runat="server" AutoGenerateColumns="False" 
            Width="100%" DataKeyNames="PartID" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" >
                           <AlternatingRowStyle BackColor="White" />
               <Columns>
                
                  <asp:TemplateField HeaderText="Part(s)" HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                         <asp:Label ID="lblPart" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                     </ItemTemplate>
                      <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>


                  <asp:TemplateField HeaderText="Price" HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                        <div style="text-align: Left">
                           <%# FormatPrice(Eval("UnitPrice")) %>
                        </div>
                     </ItemTemplate>
                      <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>


                  <asp:TemplateField HeaderText="Qty"  HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                        <div style="text-align: Left;">                            
                            <asp:Label ID="lblQuantity" runat="server" Width="30px" Text='<%# Eval("Quantity") %>'></asp:Label>
                        </div>
                     </ItemTemplate>
                     <ItemStyle Width="60px" />
                  </asp:TemplateField> 

               </Columns>
              
               <EmptyDataTemplate><b>You have no part in your basket yet</b></EmptyDataTemplate>   
                           <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                           <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                           <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                           <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                           <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                           <SortedAscendingCellStyle BackColor="#FDF5AC" />
                           <SortedAscendingHeaderStyle BackColor="#4D0000" />
                           <SortedDescendingCellStyle BackColor="#FCF6C0" />
                           <SortedDescendingHeaderStyle BackColor="#820000" />
            </asp:GridView>
		    
            <br />

               <asp:Panel runat="server" ID="panTotals">
            <div style="text-align: right; font-weight: bold; padding-top: 4px;">
           
             <p>  Subtotal: <asp:Literal runat="server" ID="lblSubtotal" />  </p> 
               <br />
              
               <p>  Shipping: <asp:Literal runat="server" ID="lblShippingCost" />  </p> 
               <br />
               <p>
               <u>Total:</u> <asp:Literal runat="server" ID="lblTotal" />
               </p>
            
               <br />
                <br />
            </div>
            </asp:Panel>

        </div>

	        </div>
	<!-- END sidebar -->
       </asp:Content>


